<template>
  <layout>
    <!-- #ifdef MP-WEIXIN -->
    <uv-navbar
      :fixed="false"
      :title="title"
      left-arrow
      @leftClick="$onClickLeft"
    />
    <!-- #endif -->
    <view style="padding: 20rpx">
      <rich-text :nodes="content"></rich-text>
    </view>
  </layout>
</template>

<script setup>
import { ref } from 'vue';
import { onLoad, onShow } from '@dcloudio/uni-app';
import { mineServiceContent } from '@/api/user';
import { storeToRefs } from 'pinia';
import { useMainStore } from '@/store/store';
const main = useMainStore();
const { currentLanguageTexts } = storeToRefs(main);
const title = ref(currentLanguageTexts.value.content);
const content = ref('');

onLoad((option) => {
  if (option.name) {
    title.value = option.name;
  }
  if (option.id) {
    getContent(option.id);
  }
});
const getContent = async (id) => {
  let data = await mineServiceContent({ id: id });
  if (data) {
    content.value = data.content;
  }
};
</script>

<style lang="scss" scoped></style>
